<%@ page language="java" pageEncoding="utf-8" contentType="text/html; charset=utf-8"%>
<%@ include file="../include/taglib.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head> 
  	<title>菜肴类别列表</title>
  	<%@ include file="../include/jsCss.jsp" %> 
  </head>
  <body>
  	<form action="mealmenutype!mealMenuTypeList.html" method="post" id="frmMealBoxList"> 
		<table width="100%" broder="1">
			<tr>
				<td width="80">类别名称：</td>
				<td width="100"><input type="text" name="menuTypeName" /></td>
				<td><input type="button" value="搜索" onclick="btnSelectMealBoxList();"/></td>
				<td align="right"><a href="mealmenutype!mealMenuType.html">添加菜肴类型</a></td>
			</tr>
		</table>
		<table border="1" width="100%">
			<tr>
				<td>序号</td>
				<td>类别</td>
				<td>状态</td>
				<td>操作</td>
			</tr>
			<s:iterator value="mealMenuTypeDtoList" status="index">
				<tr>
					<td>${index.count }</td>
					<td>${menuTypeName }</td>
					<td>
						<s:if test="status == 0">
							有效
						</s:if>
						<s:if test="status == 1">
							无效
						</s:if>
					</td>
					<td><a href="mealmenutype!mealMenuType.html?id=${id }">修改</a>|<a href="javascript:;" onclick="deleteMealMenuType(${id })">删除</a></td>
				</tr>
			</s:iterator>
		</table>
	</form> 
	<script>
		function deleteMealMenuType(id) {
			var dt = new Date();
			$.ajax( {
				type : "POST",
				url : "mealmenutype!mealMenuTypeDelete.html",
				data : "id=" + id + "&date=" + dt,
				success : function(data) {
					if ($.trim(data) == 0) {
						alert('删除成功');
						document.location.reload();
					}
				}
			});
		}
		
		function btnSelectMealBoxList(){
			$("#frmMealBoxList").submit();
		}
	</script>
	</body>
</html>